package cn.edu.neusoft.practice.Controller;





import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.edu.neusoft.practice.mapper.NowregisterMapper;
import cn.edu.neusoft.practice.mapper.WaitSeeMapper;
import cn.edu.neusoft.practice.po.Nowregister;
import cn.edu.neusoft.practice.po.WaitSee;




@CrossOrigin
@Controller
public class WaitSeeController {
	@Autowired
	private WaitSeeMapper waitSeeMapper;
	
	@RequestMapping("/getWaitSee") //查找候诊列表
	@ResponseBody
	public List<WaitSee> getWaitSee(){
		return waitSeeMapper.selectList(null); //针对于单表的查询
	}

	@Autowired
	private NowregisterMapper nowregisterMapper;
	@RequestMapping("/updateNowregister")  //更新当前后诊序号，模拟患者诊毕的流程
	 @ResponseBody
	  public int updateNowregisterId(Nowregister d){
	    return nowregisterMapper.updateById(d);

	  }
	@RequestMapping("/getNowregister") //查找患者序号
	@ResponseBody
	public List<Nowregister> getNowregister(){
		return nowregisterMapper.selectList(null); //针对于目前就诊序号的查询
	}
	 @RequestMapping("/updateWaitSee")  //更新候诊列表
	 @ResponseBody
	  public int updateWaitSee(WaitSee d){
	    return waitSeeMapper.updateById(d);

	  }
	 
	  @RequestMapping("/addWaitSee") //增加候诊信息
	  @ResponseBody
	  public int addWaitSee(WaitSee WaitSee){
	    return waitSeeMapper.insert(WaitSee);
	  }

	  @RequestMapping("/deleteWaitSee") //删除科室
	  @ResponseBody
	  public int deleteWaitSee(String registerId){
	    return waitSeeMapper.deleteById(registerId);
	  }
}

	  
	  
	  